<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>xmpp.roster</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="xmpp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="xmpp-module.html">Package&nbsp;xmpp</a> ::
        Module&nbsp;roster
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="xmpp.roster-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="xmpp.roster-module.html">Module xmpp.roster</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">##   roster.py</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   This program is free software; you can redistribute it and/or modify</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   it under the terms of the GNU General Public License as published by</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   the Free Software Foundation; either version 2, or (at your option)</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   any later version.</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##   GNU General Public License for more details.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"># $Id: roster.py,v 1.20 2005/07/13 13:22:52 snakeru Exp $</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">Simple roster implementation. Can be used though for different tasks like</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">mass-renaming of contacts.</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module xmpp.protocol=xmpp.protocol-module.html"><a title="xmpp.protocol" class="py-name" href="#" onclick="return doclink('link-0', 'protocol', 'link-0');">protocol</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-1" class="py-name" targets="Module xmpp.client=xmpp.client-module.html"><a title="xmpp.client" class="py-name" href="#" onclick="return doclink('link-1', 'client', 'link-1');">client</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Class xmpp.client.PlugIn=xmpp.client.PlugIn-class.html,Method xmpp.client.PlugIn.PlugIn()=xmpp.client.PlugIn-class.html#PlugIn,Method xmpp.transports.TLS.PlugIn()=xmpp.transports.TLS-class.html#PlugIn"><a title="xmpp.client.PlugIn
xmpp.client.PlugIn.PlugIn
xmpp.transports.TLS.PlugIn" class="py-name" href="#" onclick="return doclink('link-2', 'PlugIn', 'link-2');">PlugIn</a></tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"> </tt>
<a name="Roster"></a><div id="Roster-def"><a name="L25"></a><tt class="py-lineno"> 25</tt> <a class="py-toggle" href="#" id="Roster-toggle" onclick="return toggle('Roster');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html">Roster</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Roster-expanded"><a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">    <tt class="py-docstring">""" Defines a plenty of methods that will allow you to manage roster.</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">        Also automatically track presences from remote JIDs taking into </tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring">        account that every JID can have multiple resources connected. Does not</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">        currently support 'error' presences.</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">        You can also use mapping interface for access to the internal representation of</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">        contacts in roster.</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="Roster.__init__"></a><div id="Roster.__init__-def"><a name="L33"></a><tt class="py-lineno"> 33</tt> <a class="py-toggle" href="#" id="Roster.__init__-toggle" onclick="return toggle('Roster.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.__init__-expanded"><a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">        <tt class="py-docstring">""" Init internal variables. """</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt id="link-3" class="py-name"><a title="xmpp.client.PlugIn
xmpp.client.PlugIn.PlugIn
xmpp.transports.TLS.PlugIn" class="py-name" href="#" onclick="return doclink('link-3', 'PlugIn', 'link-2');">PlugIn</a></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method xmpp.auth.Bind.__init__()=xmpp.auth.Bind-class.html#__init__,Method xmpp.auth.ComponentBind.__init__()=xmpp.auth.ComponentBind-class.html#__init__,Method xmpp.auth.NonSASL.__init__()=xmpp.auth.NonSASL-class.html#__init__,Method xmpp.auth.SASL.__init__()=xmpp.auth.SASL-class.html#__init__,Method xmpp.browser.Browser.__init__()=xmpp.browser.Browser-class.html#__init__,Method xmpp.client.CommonClient.__init__()=xmpp.client.CommonClient-class.html#__init__,Method xmpp.client.Component.__init__()=xmpp.client.Component-class.html#__init__,Method xmpp.client.PlugIn.__init__()=xmpp.client.PlugIn-class.html#__init__,Method xmpp.commands.Command_Handler_Prototype.__init__()=xmpp.commands.Command_Handler_Prototype-class.html#__init__,Method xmpp.commands.Commands.__init__()=xmpp.commands.Commands-class.html#__init__,Method xmpp.commands.TestCommand.__init__()=xmpp.commands.TestCommand-class.html#__init__,Method xmpp.debug.Debug.__init__()=xmpp.debug.Debug-class.html#__init__,Method xmpp.debug.NoDebug.__init__()=xmpp.debug.NoDebug-class.html#__init__,Method xmpp.dispatcher.Dispatcher.__init__()=xmpp.dispatcher.Dispatcher-class.html#__init__,Method xmpp.filetransfer.IBB.__init__()=xmpp.filetransfer.IBB-class.html#__init__,Method xmpp.protocol.DataField.__init__()=xmpp.protocol.DataField-class.html#__init__,Method xmpp.protocol.DataForm.__init__()=xmpp.protocol.DataForm-class.html#__init__,Method xmpp.protocol.Error.__init__()=xmpp.protocol.Error-class.html#__init__,Method xmpp.protocol.ErrorNode.__init__()=xmpp.protocol.ErrorNode-class.html#__init__,Method xmpp.protocol.Iq.__init__()=xmpp.protocol.Iq-class.html#__init__,Method xmpp.protocol.JID.__init__()=xmpp.protocol.JID-class.html#__init__,Method xmpp.protocol.Message.__init__()=xmpp.protocol.Message-class.html#__init__,Method xmpp.protocol.Presence.__init__()=xmpp.protocol.Presence-class.html#__init__,Method xmpp.protocol.Protocol.__init__()=xmpp.protocol.Protocol-class.html#__init__,Method xmpp.roster.Roster.__init__()=xmpp.roster.Roster-class.html#__init__,Method xmpp.session.Session.__init__()=xmpp.session.Session-class.html#__init__,Method xmpp.simplexml.Node.__init__()=xmpp.simplexml.Node-class.html#__init__,Method xmpp.simplexml.NodeBuilder.__init__()=xmpp.simplexml.NodeBuilder-class.html#__init__,Method xmpp.simplexml.T.__init__()=xmpp.simplexml.T-class.html#__init__,Method xmpp.transports.HTTPPROXYsocket.__init__()=xmpp.transports.HTTPPROXYsocket-class.html#__init__,Method xmpp.transports.TCPsocket.__init__()=xmpp.transports.TCPsocket-class.html#__init__,Method xmpp.transports.error.__init__()=xmpp.transports.error-class.html#__init__"><a title="xmpp.auth.Bind.__init__
xmpp.auth.ComponentBind.__init__
xmpp.auth.NonSASL.__init__
xmpp.auth.SASL.__init__
xmpp.browser.Browser.__init__
xmpp.client.CommonClient.__init__
xmpp.client.Component.__init__
xmpp.client.PlugIn.__init__
xmpp.commands.Command_Handler_Prototype.__init__
xmpp.commands.Commands.__init__
xmpp.commands.TestCommand.__init__
xmpp.debug.Debug.__init__
xmpp.debug.NoDebug.__init__
xmpp.dispatcher.Dispatcher.__init__
xmpp.filetransfer.IBB.__init__
xmpp.protocol.DataField.__init__
xmpp.protocol.DataForm.__init__
xmpp.protocol.Error.__init__
xmpp.protocol.ErrorNode.__init__
xmpp.protocol.Iq.__init__
xmpp.protocol.JID.__init__
xmpp.protocol.Message.__init__
xmpp.protocol.Presence.__init__
xmpp.protocol.Protocol.__init__
xmpp.roster.Roster.__init__
xmpp.session.Session.__init__
xmpp.simplexml.Node.__init__
xmpp.simplexml.NodeBuilder.__init__
xmpp.simplexml.T.__init__
xmpp.transports.HTTPPROXYsocket.__init__
xmpp.transports.TCPsocket.__init__
xmpp.transports.error.__init__" class="py-name" href="#" onclick="return doclink('link-4', '__init__', 'link-4');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">DBG_LINE</tt><tt class="py-op">=</tt><tt class="py-string">'roster'</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_exported_methods</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Method xmpp.client.Client.getRoster()=xmpp.client.Client-class.html#getRoster,Method xmpp.roster.Roster.getRoster()=xmpp.roster.Roster-class.html#getRoster"><a title="xmpp.client.Client.getRoster
xmpp.roster.Roster.getRoster" class="py-name" href="#" onclick="return doclink('link-5', 'getRoster', 'link-5');">getRoster</a></tt><tt class="py-op">]</tt> </tt>
</div><a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="Roster.plugin"></a><div id="Roster.plugin-def"><a name="L41"></a><tt class="py-lineno"> 41</tt> <a class="py-toggle" href="#" id="Roster.plugin-toggle" onclick="return toggle('Roster.plugin');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">owner</tt><tt class="py-op">,</tt><tt class="py-param">request</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.plugin-expanded"><a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">        <tt class="py-docstring">""" Register presence and subscription trackers in the owner's dispatcher.</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">            Also request roster from server if the 'request' argument is set.</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">            Used internally."""</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Method xmpp.dispatcher.Dispatcher.RegisterHandler()=xmpp.dispatcher.Dispatcher-class.html#RegisterHandler"><a title="xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-6', 'RegisterHandler', 'link-6');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'iq'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method xmpp.roster.Roster.RosterIqHandler()=xmpp.roster.Roster-class.html#RosterIqHandler"><a title="xmpp.roster.Roster.RosterIqHandler" class="py-name" href="#" onclick="return doclink('link-7', 'RosterIqHandler', 'link-7');">RosterIqHandler</a></tt><tt class="py-op">,</tt><tt class="py-string">'result'</tt><tt class="py-op">,</tt><tt id="link-8" class="py-name" targets="Variable xmpp.protocol.NS_ROSTER=xmpp.protocol-module.html#NS_ROSTER"><a title="xmpp.protocol.NS_ROSTER" class="py-name" href="#" onclick="return doclink('link-8', 'NS_ROSTER', 'link-8');">NS_ROSTER</a></tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-9', 'RegisterHandler', 'link-6');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'iq'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="xmpp.roster.Roster.RosterIqHandler" class="py-name" href="#" onclick="return doclink('link-10', 'RosterIqHandler', 'link-7');">RosterIqHandler</a></tt><tt class="py-op">,</tt><tt class="py-string">'set'</tt><tt class="py-op">,</tt><tt id="link-11" class="py-name"><a title="xmpp.protocol.NS_ROSTER" class="py-name" href="#" onclick="return doclink('link-11', 'NS_ROSTER', 'link-8');">NS_ROSTER</a></tt><tt class="py-op">)</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-12', 'RegisterHandler', 'link-6');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'presence'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method xmpp.roster.Roster.PresenceHandler()=xmpp.roster.Roster-class.html#PresenceHandler"><a title="xmpp.roster.Roster.PresenceHandler" class="py-name" href="#" onclick="return doclink('link-13', 'PresenceHandler', 'link-13');">PresenceHandler</a></tt><tt class="py-op">)</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">request</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method xmpp.roster.Roster.Request()=xmpp.roster.Roster-class.html#Request"><a title="xmpp.roster.Roster.Request" class="py-name" href="#" onclick="return doclink('link-14', 'Request', 'link-14');">Request</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"> </tt>
<a name="Roster.Request"></a><div id="Roster.Request-def"><a name="L50"></a><tt class="py-lineno"> 50</tt> <a class="py-toggle" href="#" id="Roster.Request-toggle" onclick="return toggle('Roster.Request');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#Request">Request</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">force</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.Request-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.Request-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">        <tt class="py-docstring">""" Request roster from server if it were not yet requested </tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">            (or if the 'force' argument is set). """</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">force</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method xmpp.dispatcher.Dispatcher.send()=xmpp.dispatcher.Dispatcher-class.html#send,Method xmpp.transports.TCPsocket.send()=xmpp.transports.TCPsocket-class.html#send"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-15', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-16" class="py-name" targets="Class xmpp.protocol.Iq=xmpp.protocol.Iq-class.html"><a title="xmpp.protocol.Iq" class="py-name" href="#" onclick="return doclink('link-16', 'Iq', 'link-16');">Iq</a></tt><tt class="py-op">(</tt><tt class="py-string">'get'</tt><tt class="py-op">,</tt><tt id="link-17" class="py-name"><a title="xmpp.protocol.NS_ROSTER" class="py-name" href="#" onclick="return doclink('link-17', 'NS_ROSTER', 'link-8');">NS_ROSTER</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Method xmpp.client.PlugIn.DEBUG()=xmpp.client.PlugIn-class.html#DEBUG,Method xmpp.simplexml.NodeBuilder.DEBUG()=xmpp.simplexml.NodeBuilder-class.html#DEBUG,Method xmpp.transports.HTTPPROXYsocket.DEBUG()=xmpp.transports.HTTPPROXYsocket-class.html#DEBUG"><a title="xmpp.client.PlugIn.DEBUG
xmpp.simplexml.NodeBuilder.DEBUG
xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-18', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Roster requested from server'</tt><tt class="py-op">,</tt><tt class="py-string">'start'</tt><tt class="py-op">)</tt> </tt>
</div><a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"> </tt>
<a name="Roster.getRoster"></a><div id="Roster.getRoster-def"><a name="L58"></a><tt class="py-lineno"> 58</tt> <a class="py-toggle" href="#" id="Roster.getRoster-toggle" onclick="return toggle('Roster.getRoster');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getRoster">getRoster</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getRoster-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getRoster-expanded"><a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-docstring">""" Requests roster from server if neccessary and returns self."""</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="xmpp.roster.Roster.Request" class="py-name" href="#" onclick="return doclink('link-19', 'Request', 'link-14');">Request</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method xmpp.dispatcher.Dispatcher.Process()=xmpp.dispatcher.Dispatcher-class.html#Process"><a title="xmpp.dispatcher.Dispatcher.Process" class="py-name" href="#" onclick="return doclink('link-20', 'Process', 'link-20');">Process</a></tt><tt class="py-op">(</tt><tt class="py-number">10</tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt> </tt>
</div><a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"> </tt>
<a name="Roster.RosterIqHandler"></a><div id="Roster.RosterIqHandler-def"><a name="L64"></a><tt class="py-lineno"> 64</tt> <a class="py-toggle" href="#" id="Roster.RosterIqHandler-toggle" onclick="return toggle('Roster.RosterIqHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#RosterIqHandler">RosterIqHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">dis</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.RosterIqHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.RosterIqHandler-expanded"><a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-docstring">""" Subscription tracker. Used internally for setting items state in</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">            internal roster representation. """</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">item</tt> <tt class="py-keyword">in</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name" targets="Method xmpp.simplexml.Node.getTag()=xmpp.simplexml.Node-class.html#getTag"><a title="xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-21', 'getTag', 'link-21');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'query'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name" targets="Method xmpp.simplexml.Node.getTags()=xmpp.simplexml.Node-class.html#getTags"><a title="xmpp.simplexml.Node.getTags" class="py-name" href="#" onclick="return doclink('link-22', 'getTags', 'link-22');">getTags</a></tt><tt class="py-op">(</tt><tt class="py-string">'item'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">            <tt class="py-name">jid</tt><tt class="py-op">=</tt><tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method xmpp.simplexml.Node.getAttr()=xmpp.simplexml.Node-class.html#getAttr"><a title="xmpp.simplexml.Node.getAttr" class="py-name" href="#" onclick="return doclink('link-23', 'getAttr', 'link-23');">getAttr</a></tt><tt class="py-op">(</tt><tt class="py-string">'jid'</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="xmpp.simplexml.Node.getAttr" class="py-name" href="#" onclick="return doclink('link-24', 'getAttr', 'link-23');">getAttr</a></tt><tt class="py-op">(</tt><tt class="py-string">'subscription'</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'remove'</tt><tt class="py-op">:</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">del</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-25" class="py-name" targets="Class xmpp.protocol.NodeProcessed=xmpp.protocol.NodeProcessed-class.html"><a title="xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-25', 'NodeProcessed', 'link-25');">NodeProcessed</a></tt>             <tt class="py-comment"># a MUST</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="xmpp.client.PlugIn.DEBUG
xmpp.simplexml.NodeBuilder.DEBUG
xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-26', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Setting roster item %s...'</tt><tt class="py-op">%</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'name'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="xmpp.simplexml.Node.getAttr" class="py-name" href="#" onclick="return doclink('link-27', 'getAttr', 'link-23');">getAttr</a></tt><tt class="py-op">(</tt><tt class="py-string">'name'</tt><tt class="py-op">)</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'ask'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name"><a title="xmpp.simplexml.Node.getAttr" class="py-name" href="#" onclick="return doclink('link-28', 'getAttr', 'link-23');">getAttr</a></tt><tt class="py-op">(</tt><tt class="py-string">'ask'</tt><tt class="py-op">)</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'subscription'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="xmpp.simplexml.Node.getAttr" class="py-name" href="#" onclick="return doclink('link-29', 'getAttr', 'link-23');">getAttr</a></tt><tt class="py-op">(</tt><tt class="py-string">'subscription'</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'groups'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'resources'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">group</tt> <tt class="py-keyword">in</tt> <tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="xmpp.simplexml.Node.getTags" class="py-name" href="#" onclick="return doclink('link-30', 'getTags', 'link-22');">getTags</a></tt><tt class="py-op">(</tt><tt class="py-string">'group'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'groups'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">group</tt><tt class="py-op">.</tt><tt id="link-31" class="py-name" targets="Method xmpp.simplexml.Node.getData()=xmpp.simplexml.Node-class.html#getData"><a title="xmpp.simplexml.Node.getData" class="py-name" href="#" onclick="return doclink('link-31', 'getData', 'link-31');">getData</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">User</tt><tt class="py-op">+</tt><tt class="py-string">'@'</tt><tt class="py-op">+</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">Server</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'resources'</tt><tt class="py-op">:</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">,</tt><tt class="py-string">'name'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'ask'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'subscription'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'groups'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-op">}</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">set</tt><tt class="py-op">=</tt><tt class="py-number">1</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-32" class="py-name"><a title="xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-32', 'NodeProcessed', 'link-25');">NodeProcessed</a></tt>   <tt class="py-comment"># a MUST. Otherwise you'll get back an &lt;iq type='error'/&gt;</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="Roster.PresenceHandler"></a><div id="Roster.PresenceHandler-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="Roster.PresenceHandler-toggle" onclick="return toggle('Roster.PresenceHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#PresenceHandler">PresenceHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">dis</tt><tt class="py-op">,</tt><tt class="py-param">pres</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.PresenceHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.PresenceHandler-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-docstring">""" Presence tracker. Used internally for setting items' resources state in</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-docstring">            internal roster representation. """</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-name">jid</tt><tt class="py-op">=</tt><tt id="link-33" class="py-name" targets="Class xmpp.protocol.JID=xmpp.protocol.JID-class.html"><a title="xmpp.protocol.JID" class="py-name" href="#" onclick="return doclink('link-33', 'JID', 'link-33');">JID</a></tt><tt class="py-op">(</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name" targets="Method xmpp.protocol.Protocol.getFrom()=xmpp.protocol.Protocol-class.html#getFrom"><a title="xmpp.protocol.Protocol.getFrom" class="py-name" href="#" onclick="return doclink('link-34', 'getFrom', 'link-34');">getFrom</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-35" class="py-name" targets="Method xmpp.protocol.JID.getStripped()=xmpp.protocol.JID-class.html#getStripped"><a title="xmpp.protocol.JID.getStripped" class="py-name" href="#" onclick="return doclink('link-35', 'getStripped', 'link-35');">getStripped</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="xmpp.protocol.JID.getStripped" class="py-name" href="#" onclick="return doclink('link-36', 'getStripped', 'link-35');">getStripped</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'name'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'ask'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'subscription'</tt><tt class="py-op">:</tt><tt class="py-string">'none'</tt><tt class="py-op">,</tt><tt class="py-string">'groups'</tt><tt class="py-op">:</tt><tt class="py-op">[</tt><tt class="py-string">'Not in roster'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-string">'resources'</tt><tt class="py-op">:</tt><tt class="py-op">{</tt><tt class="py-op">}</tt><tt class="py-op">}</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-name">item</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="xmpp.protocol.JID.getStripped" class="py-name" href="#" onclick="return doclink('link-37', 'getStripped', 'link-35');">getStripped</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-name">typ</tt><tt class="py-op">=</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name" targets="Method xmpp.protocol.DataField.getType()=xmpp.protocol.DataField-class.html#getType,Method xmpp.protocol.DataForm.getType()=xmpp.protocol.DataForm-class.html#getType,Method xmpp.protocol.Protocol.getType()=xmpp.protocol.Protocol-class.html#getType"><a title="xmpp.protocol.DataField.getType
xmpp.protocol.DataForm.getType
xmpp.protocol.Protocol.getType" class="py-name" href="#" onclick="return doclink('link-38', 'getType', 'link-38');">getType</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">typ</tt><tt class="py-op">:</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="xmpp.client.PlugIn.DEBUG
xmpp.simplexml.NodeBuilder.DEBUG
xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-39', 'DEBUG', 'link-18');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Setting roster item %s for resource %s...'</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="xmpp.protocol.JID.getStripped" class="py-name" href="#" onclick="return doclink('link-40', 'getStripped', 'link-35');">getStripped</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-41" class="py-name" targets="Method xmpp.protocol.JID.getResource()=xmpp.protocol.JID-class.html#getResource"><a title="xmpp.protocol.JID.getResource" class="py-name" href="#" onclick="return doclink('link-41', 'getResource', 'link-41');">getResource</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">            <tt class="py-name">item</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="xmpp.protocol.JID.getResource" class="py-name" href="#" onclick="return doclink('link-42', 'getResource', 'link-41');">getResource</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">res</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'show'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'status'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-string">'priority'</tt><tt class="py-op">:</tt><tt class="py-string">'0'</tt><tt class="py-op">,</tt><tt class="py-string">'timestamp'</tt><tt class="py-op">:</tt><tt class="py-name">None</tt><tt class="py-op">}</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name"><a title="xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-43', 'getTag', 'link-21');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'show'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">res</tt><tt class="py-op">[</tt><tt class="py-string">'show'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name" targets="Method xmpp.protocol.Presence.getShow()=xmpp.protocol.Presence-class.html#getShow,Method xmpp.roster.Roster.getShow()=xmpp.roster.Roster-class.html#getShow"><a title="xmpp.protocol.Presence.getShow
xmpp.roster.Roster.getShow" class="py-name" href="#" onclick="return doclink('link-44', 'getShow', 'link-44');">getShow</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-45', 'getTag', 'link-21');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'status'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">res</tt><tt class="py-op">[</tt><tt class="py-string">'status'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name" targets="Method xmpp.protocol.Presence.getStatus()=xmpp.protocol.Presence-class.html#getStatus,Method xmpp.roster.Roster.getStatus()=xmpp.roster.Roster-class.html#getStatus"><a title="xmpp.protocol.Presence.getStatus
xmpp.roster.Roster.getStatus" class="py-name" href="#" onclick="return doclink('link-46', 'getStatus', 'link-46');">getStatus</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-47', 'getTag', 'link-21');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'priority'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">res</tt><tt class="py-op">[</tt><tt class="py-string">'priority'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name" targets="Method xmpp.protocol.Presence.getPriority()=xmpp.protocol.Presence-class.html#getPriority,Method xmpp.roster.Roster.getPriority()=xmpp.roster.Roster-class.html#getPriority"><a title="xmpp.protocol.Presence.getPriority
xmpp.roster.Roster.getPriority" class="py-name" href="#" onclick="return doclink('link-48', 'getPriority', 'link-48');">getPriority</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name" targets="Method xmpp.protocol.Protocol.getTimestamp()=xmpp.protocol.Protocol-class.html#getTimestamp"><a title="xmpp.protocol.Protocol.getTimestamp" class="py-name" href="#" onclick="return doclink('link-49', 'getTimestamp', 'link-49');">getTimestamp</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-50" class="py-name" targets="Method xmpp.protocol.Protocol.setTimestamp()=xmpp.protocol.Protocol-class.html#setTimestamp"><a title="xmpp.protocol.Protocol.setTimestamp" class="py-name" href="#" onclick="return doclink('link-50', 'setTimestamp', 'link-50');">setTimestamp</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">            <tt class="py-name">res</tt><tt class="py-op">[</tt><tt class="py-string">'timestamp'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pres</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="xmpp.protocol.Protocol.getTimestamp" class="py-name" href="#" onclick="return doclink('link-51', 'getTimestamp', 'link-49');">getTimestamp</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">typ</tt><tt class="py-op">==</tt><tt class="py-string">'unavailable'</tt> <tt class="py-keyword">and</tt> <tt class="py-name">item</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="xmpp.protocol.JID.getResource" class="py-name" href="#" onclick="return doclink('link-52', 'getResource', 'link-41');">getResource</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">del</tt> <tt class="py-name">item</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt id="link-53" class="py-name"><a title="xmpp.protocol.JID.getResource" class="py-name" href="#" onclick="return doclink('link-53', 'getResource', 'link-41');">getResource</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-comment"># Need to handle type='error' also</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="Roster._getItemData"></a><div id="Roster._getItemData-def"><a name="L104"></a><tt class="py-lineno">104</tt> <a class="py-toggle" href="#" id="Roster._getItemData-toggle" onclick="return toggle('Roster._getItemData');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#_getItemData">_getItemData</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">,</tt><tt class="py-param">dataname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster._getItemData-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster._getItemData-expanded"><a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-docstring">""" Return specific jid's representation in internal format. Used internally. """</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-name">jid</tt><tt class="py-op">=</tt><tt class="py-name">jid</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">+</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">dataname</tt><tt class="py-op">]</tt> </tt>
</div><a name="Roster._getResourceData"></a><div id="Roster._getResourceData-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="Roster._getResourceData-toggle" onclick="return toggle('Roster._getResourceData');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#_getResourceData">_getResourceData</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">,</tt><tt class="py-param">dataname</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster._getResourceData-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster._getResourceData-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-docstring">""" Return specific jid's resource representation in internal format. Used internally. """</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">jid</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-name">resource</tt><tt class="py-op">=</tt><tt class="py-name">jid</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">resource</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">resource</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">dataname</tt><tt class="py-op">]</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name" targets="Method xmpp.roster.Roster.keys()=xmpp.roster.Roster-class.html#keys"><a title="xmpp.roster.Roster.keys" class="py-name" href="#" onclick="return doclink('link-54', 'keys', 'link-54');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">            <tt class="py-name">lastpri</tt><tt class="py-op">=</tt><tt class="py-op">-</tt><tt class="py-number">129</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">r</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name"><a title="xmpp.roster.Roster.keys" class="py-name" href="#" onclick="return doclink('link-55', 'keys', 'link-54');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'priority'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">&gt;</tt><tt class="py-name">lastpri</tt><tt class="py-op">:</tt> <tt class="py-name">resource</tt><tt class="py-op">,</tt><tt class="py-name">lastpri</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">,</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">r</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'priority'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">resource</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">dataname</tt><tt class="py-op">]</tt> </tt>
</div><a name="Roster.delItem"></a><div id="Roster.delItem-def"><a name="L118"></a><tt class="py-lineno">118</tt> <a class="py-toggle" href="#" id="Roster.delItem-toggle" onclick="return toggle('Roster.delItem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#delItem">delItem</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.delItem-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.delItem-expanded"><a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-docstring">""" Delete contact 'jid' from roster."""</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-56" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-56', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-57" class="py-name"><a title="xmpp.protocol.Iq" class="py-name" href="#" onclick="return doclink('link-57', 'Iq', 'link-16');">Iq</a></tt><tt class="py-op">(</tt><tt class="py-string">'set'</tt><tt class="py-op">,</tt><tt id="link-58" class="py-name"><a title="xmpp.protocol.NS_ROSTER" class="py-name" href="#" onclick="return doclink('link-58', 'NS_ROSTER', 'link-8');">NS_ROSTER</a></tt><tt class="py-op">,</tt><tt class="py-name">payload</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt id="link-59" class="py-name" targets="Class xmpp.simplexml.Node=xmpp.simplexml.Node-class.html"><a title="xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-59', 'Node', 'link-59');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'item'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'jid'</tt><tt class="py-op">:</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'subscription'</tt><tt class="py-op">:</tt><tt class="py-string">'remove'</tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getAsk"></a><div id="Roster.getAsk-def"><a name="L121"></a><tt class="py-lineno">121</tt> <a class="py-toggle" href="#" id="Roster.getAsk-toggle" onclick="return toggle('Roster.getAsk');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getAsk">getAsk</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getAsk-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getAsk-expanded"><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns 'ask' value of contact 'jid'."""</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name" targets="Method xmpp.roster.Roster._getItemData()=xmpp.roster.Roster-class.html#_getItemData"><a title="xmpp.roster.Roster._getItemData" class="py-name" href="#" onclick="return doclink('link-60', '_getItemData', 'link-60');">_getItemData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'ask'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getGroups"></a><div id="Roster.getGroups-def"><a name="L124"></a><tt class="py-lineno">124</tt> <a class="py-toggle" href="#" id="Roster.getGroups-toggle" onclick="return toggle('Roster.getGroups');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getGroups">getGroups</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getGroups-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getGroups-expanded"><a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns groups list that contact 'jid' belongs to."""</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="xmpp.roster.Roster._getItemData" class="py-name" href="#" onclick="return doclink('link-61', '_getItemData', 'link-60');">_getItemData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'groups'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getName"></a><div id="Roster.getName-def"><a name="L127"></a><tt class="py-lineno">127</tt> <a class="py-toggle" href="#" id="Roster.getName-toggle" onclick="return toggle('Roster.getName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getName">getName</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getName-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getName-expanded"><a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns name of contact 'jid'."""</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-62" class="py-name"><a title="xmpp.roster.Roster._getItemData" class="py-name" href="#" onclick="return doclink('link-62', '_getItemData', 'link-60');">_getItemData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'name'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getPriority"></a><div id="Roster.getPriority-def"><a name="L130"></a><tt class="py-lineno">130</tt> <a class="py-toggle" href="#" id="Roster.getPriority-toggle" onclick="return toggle('Roster.getPriority');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getPriority">getPriority</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getPriority-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getPriority-expanded"><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns priority of contact 'jid'. 'jid' should be a full (not bare) JID."""</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-63" class="py-name" targets="Method xmpp.roster.Roster._getResourceData()=xmpp.roster.Roster-class.html#_getResourceData"><a title="xmpp.roster.Roster._getResourceData" class="py-name" href="#" onclick="return doclink('link-63', '_getResourceData', 'link-63');">_getResourceData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'priority'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getRawRoster"></a><div id="Roster.getRawRoster-def"><a name="L133"></a><tt class="py-lineno">133</tt> <a class="py-toggle" href="#" id="Roster.getRawRoster-toggle" onclick="return toggle('Roster.getRawRoster');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getRawRoster">getRawRoster</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getRawRoster-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getRawRoster-expanded"><a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns roster representation in internal format. """</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt> </tt>
</div><a name="Roster.getRawItem"></a><div id="Roster.getRawItem-def"><a name="L136"></a><tt class="py-lineno">136</tt> <a class="py-toggle" href="#" id="Roster.getRawItem-toggle" onclick="return toggle('Roster.getRawItem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getRawItem">getRawItem</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getRawItem-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getRawItem-expanded"><a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns roster item 'jid' representation in internal format. """</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">+</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
</div><a name="Roster.getShow"></a><div id="Roster.getShow-def"><a name="L139"></a><tt class="py-lineno">139</tt> <a class="py-toggle" href="#" id="Roster.getShow-toggle" onclick="return toggle('Roster.getShow');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getShow">getShow</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getShow-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getShow-expanded"><a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns 'show' value of contact 'jid'. 'jid' should be a full (not bare) JID."""</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="xmpp.roster.Roster._getResourceData" class="py-name" href="#" onclick="return doclink('link-64', '_getResourceData', 'link-63');">_getResourceData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'show'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getStatus"></a><div id="Roster.getStatus-def"><a name="L142"></a><tt class="py-lineno">142</tt> <a class="py-toggle" href="#" id="Roster.getStatus-toggle" onclick="return toggle('Roster.getStatus');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getStatus">getStatus</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getStatus-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getStatus-expanded"><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns 'status' value of contact 'jid'. 'jid' should be a full (not bare) JID."""</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="xmpp.roster.Roster._getResourceData" class="py-name" href="#" onclick="return doclink('link-65', '_getResourceData', 'link-63');">_getResourceData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'status'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getSubscription"></a><div id="Roster.getSubscription-def"><a name="L145"></a><tt class="py-lineno">145</tt> <a class="py-toggle" href="#" id="Roster.getSubscription-toggle" onclick="return toggle('Roster.getSubscription');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getSubscription">getSubscription</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getSubscription-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getSubscription-expanded"><a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns 'subscription' value of contact 'jid'."""</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-66" class="py-name"><a title="xmpp.roster.Roster._getItemData" class="py-name" href="#" onclick="return doclink('link-66', '_getItemData', 'link-60');">_getItemData</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'subscription'</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getResources"></a><div id="Roster.getResources-def"><a name="L148"></a><tt class="py-lineno">148</tt> <a class="py-toggle" href="#" id="Roster.getResources-toggle" onclick="return toggle('Roster.getResources');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getResources">getResources</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getResources-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getResources-expanded"><a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">        <tt class="py-docstring">""" Returns list of connected resources of contact 'jid'."""</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">jid</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">+</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'resources'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="xmpp.roster.Roster.keys" class="py-name" href="#" onclick="return doclink('link-67', 'keys', 'link-54');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.setItem"></a><div id="Roster.setItem-def"><a name="L151"></a><tt class="py-lineno">151</tt> <a class="py-toggle" href="#" id="Roster.setItem-toggle" onclick="return toggle('Roster.setItem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#setItem">setItem</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">groups</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.setItem-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.setItem-expanded"><a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">        <tt class="py-docstring">""" Creates/renames contact 'jid' and sets the groups list that it now belongs to."""</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">        <tt class="py-name">iq</tt><tt class="py-op">=</tt><tt id="link-68" class="py-name"><a title="xmpp.protocol.Iq" class="py-name" href="#" onclick="return doclink('link-68', 'Iq', 'link-16');">Iq</a></tt><tt class="py-op">(</tt><tt class="py-string">'set'</tt><tt class="py-op">,</tt><tt id="link-69" class="py-name"><a title="xmpp.protocol.NS_ROSTER" class="py-name" href="#" onclick="return doclink('link-69', 'NS_ROSTER', 'link-8');">NS_ROSTER</a></tt><tt class="py-op">)</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">        <tt class="py-name">query</tt><tt class="py-op">=</tt><tt class="py-name">iq</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name"><a title="xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-70', 'getTag', 'link-21');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'query'</tt><tt class="py-op">)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">        <tt class="py-name">attrs</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'jid'</tt><tt class="py-op">:</tt><tt class="py-name">jid</tt><tt class="py-op">}</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-71" class="py-name" targets="Variable xmpp.auth.name=xmpp.auth-module.html#name,Variable xmpp.browser.name=xmpp.browser-module.html#name,Variable xmpp.commands.Command_Handler_Prototype.name=xmpp.commands.Command_Handler_Prototype-class.html#name,Variable xmpp.commands.TestCommand.name=xmpp.commands.TestCommand-class.html#name,Variable xmpp.commands.name=xmpp.commands-module.html#name,Variable xmpp.dispatcher.name=xmpp.dispatcher-module.html#name,Variable xmpp.features.name=xmpp.features-module.html#name,Variable xmpp.filetransfer.name=xmpp.filetransfer-module.html#name,Variable xmpp.name=xmpp-module.html#name,Variable xmpp.protocol.name=xmpp.protocol-module.html#name,Variable xmpp.roster.name=xmpp.roster-module.html#name,Variable xmpp.session.name=xmpp.session-module.html#name,Variable xmpp.transports.name=xmpp.transports-module.html#name"><a title="xmpp.auth.name
xmpp.browser.name
xmpp.commands.Command_Handler_Prototype.name
xmpp.commands.TestCommand.name
xmpp.commands.name
xmpp.dispatcher.name
xmpp.features.name
xmpp.filetransfer.name
xmpp.name
xmpp.protocol.name
xmpp.roster.name
xmpp.session.name
xmpp.transports.name" class="py-name" href="#" onclick="return doclink('link-71', 'name', 'link-71');">name</a></tt><tt class="py-op">:</tt> <tt class="py-name">attrs</tt><tt class="py-op">[</tt><tt class="py-string">'name'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt id="link-72" class="py-name"><a title="xmpp.auth.name
xmpp.browser.name
xmpp.commands.Command_Handler_Prototype.name
xmpp.commands.TestCommand.name
xmpp.commands.name
xmpp.dispatcher.name
xmpp.features.name
xmpp.filetransfer.name
xmpp.name
xmpp.protocol.name
xmpp.roster.name
xmpp.session.name
xmpp.transports.name" class="py-name" href="#" onclick="return doclink('link-72', 'name', 'link-71');">name</a></tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">        <tt class="py-name">item</tt><tt class="py-op">=</tt><tt class="py-name">query</tt><tt class="py-op">.</tt><tt id="link-73" class="py-name" targets="Method xmpp.simplexml.Node.setTag()=xmpp.simplexml.Node-class.html#setTag"><a title="xmpp.simplexml.Node.setTag" class="py-name" href="#" onclick="return doclink('link-73', 'setTag', 'link-73');">setTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'item'</tt><tt class="py-op">,</tt><tt class="py-name">attrs</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">group</tt> <tt class="py-keyword">in</tt> <tt class="py-name">groups</tt><tt class="py-op">:</tt> <tt class="py-name">item</tt><tt class="py-op">.</tt><tt id="link-74" class="py-name" targets="Method xmpp.simplexml.Node.addChild()=xmpp.simplexml.Node-class.html#addChild"><a title="xmpp.simplexml.Node.addChild" class="py-name" href="#" onclick="return doclink('link-74', 'addChild', 'link-74');">addChild</a></tt><tt class="py-op">(</tt><tt class="py-name">node</tt><tt class="py-op">=</tt><tt id="link-75" class="py-name"><a title="xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-75', 'Node', 'link-59');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'group'</tt><tt class="py-op">,</tt><tt class="py-name">payload</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-name">group</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-76" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-76', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt class="py-name">iq</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.getItems"></a><div id="Roster.getItems-def"><a name="L160"></a><tt class="py-lineno">160</tt> <a class="py-toggle" href="#" id="Roster.getItems-toggle" onclick="return toggle('Roster.getItems');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getItems">getItems</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getItems-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getItems-expanded"><a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">        <tt class="py-docstring">""" Return list of all [bare] JIDs that the roster is currently tracks."""</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt id="link-77" class="py-name"><a title="xmpp.roster.Roster.keys" class="py-name" href="#" onclick="return doclink('link-77', 'keys', 'link-54');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.keys"></a><div id="Roster.keys-def"><a name="L163"></a><tt class="py-lineno">163</tt> <a class="py-toggle" href="#" id="Roster.keys-toggle" onclick="return toggle('Roster.keys');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#keys">keys</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.keys-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.keys-expanded"><a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">        <tt class="py-docstring">""" Same as getItems. Provided for the sake of dictionary interface."""</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name"><a title="xmpp.roster.Roster.keys" class="py-name" href="#" onclick="return doclink('link-78', 'keys', 'link-54');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.__getitem__"></a><div id="Roster.__getitem__-def"><a name="L166"></a><tt class="py-lineno">166</tt> <a class="py-toggle" href="#" id="Roster.__getitem__-toggle" onclick="return toggle('Roster.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.__getitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.__getitem__-expanded"><a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt class="py-docstring">""" Get the contact in the internal format. Raises KeyError if JID 'item' is not in roster."""</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">item</tt><tt class="py-op">]</tt> </tt>
</div><a name="Roster.getItem"></a><div id="Roster.getItem-def"><a name="L169"></a><tt class="py-lineno">169</tt> <a class="py-toggle" href="#" id="Roster.getItem-toggle" onclick="return toggle('Roster.getItem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#getItem">getItem</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.getItem-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.getItem-expanded"><a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt class="py-docstring">""" Get the contact in the internal format (or None if JID 'item' is not in roster)."""</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-name">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_data</tt><tt class="py-op">[</tt><tt class="py-name">item</tt><tt class="py-op">]</tt> </tt>
</div><a name="Roster.Subscribe"></a><div id="Roster.Subscribe-def"><a name="L172"></a><tt class="py-lineno">172</tt> <a class="py-toggle" href="#" id="Roster.Subscribe-toggle" onclick="return toggle('Roster.Subscribe');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#Subscribe">Subscribe</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.Subscribe-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.Subscribe-expanded"><a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">        <tt class="py-docstring">""" Send subscription request to JID 'jid'."""</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-79', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-80" class="py-name" targets="Class xmpp.protocol.Presence=xmpp.protocol.Presence-class.html"><a title="xmpp.protocol.Presence" class="py-name" href="#" onclick="return doclink('link-80', 'Presence', 'link-80');">Presence</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'subscribe'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.Unsubscribe"></a><div id="Roster.Unsubscribe-def"><a name="L175"></a><tt class="py-lineno">175</tt> <a class="py-toggle" href="#" id="Roster.Unsubscribe-toggle" onclick="return toggle('Roster.Unsubscribe');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#Unsubscribe">Unsubscribe</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.Unsubscribe-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.Unsubscribe-expanded"><a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">        <tt class="py-docstring">""" Ask for removing our subscription for JID 'jid'."""</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-81', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-82" class="py-name"><a title="xmpp.protocol.Presence" class="py-name" href="#" onclick="return doclink('link-82', 'Presence', 'link-80');">Presence</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'unsubscribe'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.Authorize"></a><div id="Roster.Authorize-def"><a name="L178"></a><tt class="py-lineno">178</tt> <a class="py-toggle" href="#" id="Roster.Authorize-toggle" onclick="return toggle('Roster.Authorize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#Authorize">Authorize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.Authorize-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.Authorize-expanded"><a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">        <tt class="py-docstring">""" Authorise JID 'jid'. Works only if these JID requested auth previously. """</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-83', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-84" class="py-name"><a title="xmpp.protocol.Presence" class="py-name" href="#" onclick="return doclink('link-84', 'Presence', 'link-80');">Presence</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'subscribed'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="Roster.Unauthorize"></a><div id="Roster.Unauthorize-def"><a name="L181"></a><tt class="py-lineno">181</tt> <a class="py-toggle" href="#" id="Roster.Unauthorize-toggle" onclick="return toggle('Roster.Unauthorize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="xmpp.roster.Roster-class.html#Unauthorize">Unauthorize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">jid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Roster.Unauthorize-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Roster.Unauthorize-expanded"><a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">        <tt class="py-docstring">""" Unauthorise JID 'jid'. Use for declining authorisation request </tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"><tt class="py-docstring">            or for removing existing authorization. """</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="xmpp.dispatcher.Dispatcher.send
xmpp.transports.TCPsocket.send" class="py-name" href="#" onclick="return doclink('link-85', 'send', 'link-15');">send</a></tt><tt class="py-op">(</tt><tt id="link-86" class="py-name"><a title="xmpp.protocol.Presence" class="py-name" href="#" onclick="return doclink('link-86', 'Presence', 'link-80');">Presence</a></tt><tt class="py-op">(</tt><tt class="py-name">jid</tt><tt class="py-op">,</tt><tt class="py-string">'unsubscribed'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="xmpp-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Sat Dec 15 22:25:21 2007
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
